using EnvDTE80;
using Microsoft.Practices.RecipeFramework;
using VSSDKAssist.Assets.Actions.Base;
using VSSDKAssist.Assets.Helpers;

namespace VSSDKAssist.Assets.Actions.General
{
	/// <summary>
	/// Action to audit execution
	/// </summary>
	public class AuditAction : ActionBase
	{
		#region Properties
		private string message;

		/// <summary>
		/// Gets or sets the message.
		/// </summary>
		/// <value>The message.</value>
		[Input(Required = true)]
		public string Message
		{
			get { return message; }
			set { message = value; }
		}

		private string paneName;

		/// <summary>
		/// Gets or sets the name of the pane.
		/// </summary>
		/// <value>The name of the pane.</value>
		[Input(Required = true)]
		public string PaneName
		{
			get { return paneName; }
			set { paneName = value; }
		}
		#endregion

		/// <summary>
		/// Called when [execute].
		/// </summary>
		protected override void OnExecute()
		{
			OutputWindowHelper outputWindowHelper = 
				new OutputWindowHelper((DTE2)VisualStudio, this.paneName);

			outputWindowHelper.WriteMessage(message);
		}
	}
}